fix(desktop): persist window size and position - #6978
Conversation
The default 910x600 size was applied after window creation, which overwrote the saved frame before restore. Showing an already-open window also reapplied that stale state, so opening Settings from a meeting jumped the frame. Restore size, position, and maximized on create, keep live geometry when showing an existing window, and stop shrinking the window just because the user left a meeting view. Co-authored-by: John Jeong <ComputelessComputer@users.noreply.github.com>
✅ Deploy Preview for anarlog canceled.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 70c62cb. Configure here.
| (enabled && !leftPanelOpen && !rightPanelOpen) | ||
| ) { | ||
| restoreWidthExpansions(); | ||
| } |
There was a problem hiding this comment.
Re-entry re-expands unsaved width
Medium Severity
Skipping restore when leaving a meeting with docked chat open no longer matches the “panel just opened” detection. Returning to a note-surface tab still treats leftPanelOpen / rightPanelOpen as newly opened via !previousState.enabled, so the width guard can expand again on top of the already-expanded frame and stack another restorable expansion.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 70c62cb. Configure here.


Joey reported that the app forgets window size and position on almost every launch, and also jumps when going from a meeting to Settings. 1.4.11 only stopped recentering after updates, so the frame still reset.
Cause
tauri-plugin-window-statekeeps the saved frame in an in-memory cache. The main window was created, then immediately forced to 910×600, and the plugin’s resize listener wrote that default over the saved frame before restore ran. Re-showing an already-open window (tray, floating bar, Settings) applied that stale frame again. Leaving a meeting also restored temporary chat-panel width expansions even when chat was still open.Fix
Testing
pnpm -F desktop test src/shared/main/chat-panels.test.tsxpnpm -F desktop typecheckpnpm exec oxlint --quiet --format=github apps/desktop/src/shared/main/chat-panels.tsx apps/desktop/src/shared/main/chat-panels.test.tsxcargo test -p tauri-plugin-windowscould not run here (GTKgdk-3.0.pcis not installed in this environment).